package com.qfedu.service.impl;

import com.qfedu.dao.SysCityMapper;
import com.qfedu.pojo.SysCity;
import com.qfedu.service.SysCityService;
import com.qfedu.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class SysCityServiceImpl implements SysCityService {
    @Autowired
    SysCityMapper sysCityMapper;
    @Override
    public BaseResult findCity(Integer getid, Integer backid) {
        SysCity getCity=sysCityMapper.findGetcity(getid);
        SysCity backCity=sysCityMapper.findBackcity(backid);
        Map map=new HashMap<String,String>();
        map.put("getCity",getCity);
        map.put("backCity",backCity);
        BaseResult baseResult=new BaseResult();
        baseResult.setCode(1);
        baseResult.setInfo(map);
        return baseResult;
    }

    @Override
    public BaseResult select(Integer pid) {
     List<SysCity>sysCityList= sysCityMapper.select(pid);
        BaseResult baseResult = new BaseResult();
        baseResult.setInfo(sysCityList);
        return baseResult;
    }
}
